﻿<common:LayoutAwarePage x:Class="StoreAppLibDemo.Examples.Controls.AppBarButtonPage"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:common="using:StoreAppLibDemo.Common"
                        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                        xmlns:local="using:StoreAppLibDemo.Examples.Controls"
                        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                        xmlns:storeAppControl="using:StoreAppLib.Controls"
                        mc:Ignorable="d">

    <Grid Style="{StaticResource AppPageStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="40" />
            <RowDefinition />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Image Grid.Column="1"
                   Margin="0,0,50,0"
                   Source="ms-appx:///Assets/PageLogo.png" />
            <TextBlock Margin="120,0,0,0"
                       HorizontalAlignment="Left"
                       VerticalAlignment="Bottom"
                       Style="{StaticResource HeaderTextStyle}"
                       Text="Appbar Button"
                       TextWrapping="Wrap" />
            <Button Margin="36,0,0,0"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Bottom"
                    Click="GoBack"
                    Content="Button"
                    Style="{StaticResource BackButtonStyle}" />

        </Grid>

        <TextBlock Grid.Row="3"
                   Margin="0,0,50,0"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Center"
                   FontSize="9"
                   Text="Copyright ©  2012 Suresh Kumar T" />
        <Grid Grid.Row="2" Margin="120,0,50,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="40" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Style="{StaticResource BodyTextStyle}">
                <Run>Appbar Button represents a Windows 8 Store Application AppBar button. The button supports built-in popup menu and developers can add the menu items in the page XAML file. To perform an action when a user taps any menu, add a handler for the MenuItemInvoked
                event. You can also invoke a command when user tap on any menu by binding an ICommand implementation that describes the command logic to the MenuCommand
                property.</Run>
                <LineBreak />
                <LineBreak />
                <Run>To view AppBar Button menu in action, tap on the buttons in the AppBar. The page DataContext is assigned in the code-behind. In this example &quot;Right Button&quot; shows the use of MenuCommand
                . Other buttons handle the MenuItemInvoked.</Run>
                event.
            </TextBlock>
            <StackPanel Grid.Row="2"
                        Margin="0"
                        Orientation="Horizontal">
                <TextBlock Style="{StaticResource BodyTextStyle}" Text="Selected Appbar button menu item : " />
                <TextBlock Style="{StaticResource BodyTextStyle}" Text="{Binding SelectedMenuLabel}" />
            </StackPanel>
        </Grid>
    </Grid>
    <Page.BottomAppBar>
        <AppBar IsSticky="False">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0"
                            HorizontalAlignment="Left"
                            Orientation="Horizontal">

                    <storeAppControl:AppBarButton Caption="Left Button"
                                                  MenuItemInvoked="OnAppBarMenuItemInvoked"
                                                  Style="{StaticResource SortAppBarButtonStyle}">
                        <storeAppControl:AppBarButton.Menu>
                            <storeAppControl:Menu>
                                <storeAppControl:Menu.Items>
                                    <storeAppControl:MenuItem Label="Date Picker" />
                                    <storeAppControl:MenuItem Label="Page Header" />
                                    <storeAppControl:MenuItem Label="App Bar Button" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Tap Effect" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Date time converter" />
                                    <storeAppControl:MenuItem Label="Count Converter" />
                                    <storeAppControl:MenuItem Label="Concatenation Converter" />
                                </storeAppControl:Menu.Items>
                            </storeAppControl:Menu>
                        </storeAppControl:AppBarButton.Menu>
                    </storeAppControl:AppBarButton>

                    <storeAppControl:AppBarButton Caption="Border Style"
                                                  MenuItemInvoked="OnAppBarMenuItemInvoked"
                                                  Style="{StaticResource SortAppBarButtonStyle}">
                        <storeAppControl:AppBarButton.Menu>
                            <storeAppControl:Menu BorderBrush="Red" BorderThickness="4">
                                <storeAppControl:Menu.Items>
                                    <storeAppControl:MenuItem Label="Date Picker" />
                                    <storeAppControl:MenuItem Label="Page Header" />
                                    <storeAppControl:MenuItem Label="App Bar Button" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Tap Effect" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Date time converter" />
                                    <storeAppControl:MenuItem Label="Count Converter" />
                                    <storeAppControl:MenuItem Label="Concatenation Converter" />
                                </storeAppControl:Menu.Items>
                            </storeAppControl:Menu>
                        </storeAppControl:AppBarButton.Menu>
                    </storeAppControl:AppBarButton>
                </StackPanel>

                <StackPanel Grid.Column="1"
                            HorizontalAlignment="Right"
                            Orientation="Horizontal">

                    <storeAppControl:AppBarButton Caption="Left Align"
                                                  MenuItemInvoked="OnAppBarMenuItemInvoked"
                                                  Style="{StaticResource SortAppBarButtonStyle}">
                        <storeAppControl:AppBarButton.Menu>
                            <storeAppControl:Menu HorizontalContentAlignment="Left">
                                <storeAppControl:Menu.Items>
                                    <storeAppControl:MenuItem Label="Date Picker" />
                                    <storeAppControl:MenuItem Label="Page Header" />
                                    <storeAppControl:MenuItem Label="App Bar Button" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Date time converter" />
                                    <storeAppControl:MenuItem Label="Count Converter" />
                                    <storeAppControl:MenuItem Label="Concatenation Converter" />
                                </storeAppControl:Menu.Items>
                            </storeAppControl:Menu>
                        </storeAppControl:AppBarButton.Menu>
                    </storeAppControl:AppBarButton>


                    <storeAppControl:AppBarButton Caption="10 Menu Items"
                                                  MenuItemInvoked="OnAppBarMenuItemInvoked"
                                                  Style="{StaticResource SortAppBarButtonStyle}">
                        <storeAppControl:AppBarButton.Menu>
                            <storeAppControl:Menu PointerOverBackground="LightBlue" PressedBackground="Blue">
                                <storeAppControl:Menu.Items>
                                    <storeAppControl:MenuItem Label="Item 1" />
                                    <storeAppControl:MenuItem Label="Item 2" />
                                    <storeAppControl:MenuItem Label="Item 3" />
                                    <storeAppControl:MenuItem Label="Item 4" />
                                    <storeAppControl:MenuItem Label="Item 5" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Item 6" />
                                    <storeAppControl:MenuItem Label="Item 7" />
                                    <storeAppControl:MenuItem Label="Item 8" />
                                    <storeAppControl:MenuItem Label="Item 9" />
                                    <storeAppControl:MenuItem Label="Item 10" />
                                </storeAppControl:Menu.Items>
                            </storeAppControl:Menu>
                        </storeAppControl:AppBarButton.Menu>
                    </storeAppControl:AppBarButton>

                    <storeAppControl:AppBarButton Caption="Custom Menu"
                                                  MenuItemInvoked="OnAppBarMenuItemInvoked"
                                                  Style="{StaticResource SortAppBarButtonStyle}">
                        <storeAppControl:AppBarButton.Menu>
                            <storeAppControl:Menu Background="#FFAA3838"
                                                  BorderBrush="#FFFF4141"
                                                  BorderThickness="4"
                                                  Foreground="White"
                                                  PointerOverBackground="#FFAF4343"
                                                  PressedBackground="#FFA90000"
                                                  SeparatorColor="#FFFF4141"
                                                  SeparatorThickness="3">
                                <storeAppControl:Menu.Items>
                                    <storeAppControl:MenuItem Label="Date Picker" />
                                    <storeAppControl:MenuItem Label="Page Header" />
                                    <storeAppControl:MenuItem Label="App Bar Button" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Tap Effect" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Date time converter" />
                                    <storeAppControl:MenuItem Label="Count Converter" />
                                    <storeAppControl:MenuItem Label="Concatenation Converter" />
                                </storeAppControl:Menu.Items>
                            </storeAppControl:Menu>
                        </storeAppControl:AppBarButton.Menu>
                    </storeAppControl:AppBarButton>

                    <storeAppControl:AppBarButton Caption="Right Button"
                                                  MenuCommand="{Binding MenuCommand}"
                                                  Style="{StaticResource SortAppBarButtonStyle}">
                        <storeAppControl:AppBarButton.Menu>
                            <storeAppControl:Menu>
                                <storeAppControl:Menu.Items>
                                    <storeAppControl:MenuItem Label="Date Picker" />
                                    <storeAppControl:MenuItem Label="Page Header" />
                                    <storeAppControl:MenuItem Label="App Bar Button" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Tap Effect" />
                                    <storeAppControl:MenuSeparator />
                                    <storeAppControl:MenuItem Label="Date time converter" />
                                    <storeAppControl:MenuItem Label="Count Converter" />
                                    <storeAppControl:MenuItem Label="Concatenation Converter" />
                                </storeAppControl:Menu.Items>
                            </storeAppControl:Menu>
                        </storeAppControl:AppBarButton.Menu>
                    </storeAppControl:AppBarButton>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
</common:LayoutAwarePage>